package com.yupi.yupao.common;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author zy
 * @Date 2024/10/21 19:03
 * @packageName:com.yupi.usercenter.common
 * @ClassName:BaseResponse
 *
 * 反馈对象
 */
@Data
public class BaseResponse<T>  implements Serializable {
    private int code;//编码

    private T data;//返回的数据

    private  String message;//错误信息

    private String descriptions;

    public BaseResponse(int code, T data, String message,String descriptions) {
        this.code = code;

        this.data = data;

        this.message = message;
        this.descriptions=descriptions;
    }

    public BaseResponse(int code, T data,String message) {
        this(code,data,message,"");
    }
    public BaseResponse(int code, T data) {
        this(code,data,"","");
    }
    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(),null,errorCode.getMessage(),errorCode.getDescriptions());
    }


}
